#pragma once
#ifndef xWindow_h__
#define xWindow_h__

#include "./xRes.h"

namespace Sky
{
	using namespace Sky;
	class xDxApp;
	class xWindow: public xAppRes<HWND>
	{
	public:
		xWindow();
		virtual TResult onCreate(xDxApp* app);
		virtual TResult onDelete(xDxApp* app);
		xWindow& setStyle(TUint s){m_Style = s;return *this;}
		xWindow& setStartX(TInt x){m_StartX = x;return *this;}
		xWindow& setStartY(TInt y){m_StartY = y;return *this;}
		xWindow& setHeight(TInt h){m_Height = h;return *this;}
		xWindow& setWidth(TInt w){m_Width = w;return *this;}
		xWindow& setTitle(Sky::StringPtr& title);
		TUint	getStyle(){return m_Style;}
		TInt	getStartX(){return m_StartX;}
		TInt	getStartY(){return m_StartY;}
		TInt	getWidth(){return m_Width;}
		TInt	getHeight(){return m_Height;}
		HWND	getHWnd();
		Sky::StringPtr& getTitle(){return m_Title;}
		TBool  attach(HWND hwnd);
		TVoid  detach();
		TVoid  show(TBool bShow);
		TVoid  close();
	private:
		TInt m_StartX;
		TInt m_StartY;
		TInt m_Width;
		TInt m_Height;
		Sky::StringPtr m_Title;
		TUint m_Style;
		HWND  m_hWnd;;
	};
}
#endif // xWindow_h__